package com.example.demo.repository;


import com.example.demo.entity.User;
import com.example.demo.vo.UserInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserRepository extends JpaRepository<User, Long> {
//    //按姓名模糊查询
//    List<User> findByUsrNameLike(String s);
//    @Query("select u from User u where u.usrRoleId=?1")
//    Page<User> findPageByUsrRoleId(Long usrRoleId, Pageable pageable);
//
//    Page<User> findAll(Specification<User> specification, Pageable pageable);
//
//    @Query("select u.usrId as usrId,u.usrName as usrName,u.usrPassword as usrPassword," +
//            "u.usrRoleId as usrRoleId,u.usrFlag as usrFlag,r.roleName as roleName " +
//            "from User u,Role r where u.usrRoleId=r.roleId and u.usrId=?1")
//    public UserInfo getUserInfo(Long userId);
}
